import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;


public class readText {

    static String readText(String filename, byte[] b) throws IOException{
        String fn;
        fn = ".files" + filename;
        StringBuffer sb = new StringBuffer(2048);
        String res="";
        String string = new String(b, "UTF-8");
        string = "==="+string+"===";
        System.out.println("Searching for sections with your key in file " + fn + "\n");
        try {
            BufferedReader in = new BufferedReader(new FileReader(fn));
            String str;
            while((str = in.readLine()) != null){
                if(str.equals(string)){
                    break;
                }
            }
            while((str = in.readLine()) != null){
                if(str.equals(string)){
                    break;
                }
                sb.append("\n" + str);
            }
            in.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        res=sb.toString();
        return res;
    }

    public static void main(String[] args) throws IOException {
       byte[] b = {1,2,3};
       System.in.read(b);
       String list[] = new File(".files").list();



       for(String i: list){
           String out;
           out = readText(list[i], b);
           System.out.println(out + "\n");
       }


    }
}
